﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ERPStudio;
using System.Data.SqlClient;

namespace AMix
{
    public partial class DocRezumatFrm : FrmRezumat
    {
        private short Luna = 0;
        private short Anul = 0;
        private Boolean MijlocFix = true;
        public DocRezumatFrm(ModuleClass mc,short luna, short an,Boolean mf): base(mc)
        {
            InitializeComponent();
            workConnString = mc.workConnectionString;
            Luna = luna;
            Anul = an;
            MijlocFix = mf;
        }

        private void DocRezumatFrm_Load(object sender, EventArgs e)
        {
            SqlConnection con = DeschideConexiune(workConnString);
            departamenteTableAdapter.Connection = con;
            departamenteTableAdapter.Fill(eSRPDataSet.Departamente, ModuleInfo.CodUnitate);
            amixTipModDocumentTableAdapter.Connection = con;
            amixTipModDocumentTableAdapter.FillAll(eSRPDataSet.AmixTipModDocument);
            this.amixDocumenteTableAdapter.Connection = con;
            this.amixDocumenteTableAdapter.FillByLunaAn(this.eSRPDataSet.AmixDocumente, ModuleInfo.CodUnitate,Luna,Anul,(short)(MijlocFix?0:3),(short)(MijlocFix?2:5));
            InchideConexiune(con);

            AddBindingSource(amixDocumenteBindingSource);
            AddTableAdaptor(amixDocumenteTableAdapter.Adapter);


        }

        private void amixDocumenteDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
